package a1;

public class A02_test {
    public static void main(String[] args) {
        String str = "01234567896";
        if(!str.matches("[1-9]\\d{0,9}")){
            System.out.println("数据格式不正确！");
        }else{
            System.out.println("数据格式正确！");
            int number = 0;
            for(int i=0;i<str.length();i++){
                int c = str.charAt(i) - '0';
                number = number * 10 +c;
            }
            System.out.println(number);
        }
    }
}
